#include "tests.h"
#include "ini.h"

int init_test_suite_read_from_file(void)
{
    // use the default ini path!
    return (INI_Init(0) ? 0 : 1);
}

int cleanup_test_suite_read_from_file(void)
{
	INI_Free();

    return 0;
}

void test_email_read_from_file_1()
{	
	int count = 0;

	count = INI_FeedCount();
	CU_ASSERT_TRUE(count);
}

void test_email_read_from_file_2()
{	
	int count = 0;

	count = INI_CustomerCount();
	CU_ASSERT_TRUE(count);
}


void add_test_suite_read_from_file()
{
    CU_pSuite pSuite = NULL;

    /* add a suite to the registry */
    pSuite = CU_add_suite("Read from file test suite", init_test_suite_read_from_file, cleanup_test_suite_read_from_file);
    if (NULL == pSuite) {
        print_last_error();
        return;
    }

    /* add the tests to the suite */
    if ((NULL == CU_ADD_TEST(pSuite, test_email_read_from_file_1)) ||
        (NULL == CU_ADD_TEST(pSuite, test_email_read_from_file_2)))
    {
        print_last_error();
        return;
    }
}